<?php

/**
 * This is the model class for table "ramp".
 *
 * The followings are the available columns in table 'ramp':
 * @property integer $id
 * @property integer $provided
 * @property string $type
 * @property string $ramp_width
 * @property string $units_of_measurement_of_ramp_width
 * @property string $class
 * @property integer $railing_provided
 * @property string $height_from_the_floor
 * @property string $units_of_measurement_of_the_height_from_the_floor
 * @property integer $enclosure_provided
 * @property string $enclosure_construction
 * @property integer $fire_door_provided
 * @property string $fd_width
 * @property string $units_of_measurement_of_the_fd_width
 * @property string $fire_door_construction
 * @property integer $door_equipped_with_self_closing_device
 * @property integer $door_with_proper_rating
 * @property integer $door_provided_with_vision_panel
 * @property string $if_yes_made_of
 * @property integer $door_swing_in_the_direction_of_exit_travel
 * @property integer $any_obstruction
 * @property string $termination_or_discharge_of_exit
 * @property integer $exit_detail_id
 *
 * The followings are the available model relations:
 * @property ExitDetail $exitDetail
 */
class Ramp extends CActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @param string $className active record class name.
	 * @return Ramp the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}
const a = "Interior";
const b ="Exterior";
public function getType(){
return array(
self::a=>"Interior",
self::b=>"Exterior"
);


}
const c = "Foot";
const d ="Inches";
public function getMeasurement(){
return array(
self::c=>"Foot",
self::d=>"Inches"
);


}

const e = "Foot";
const f ="Inches";
public function getMeasurementa(){
return array(
self::e=>"Foot",
self::f=>"Inches"
);


}
const g = "Foot";
const h ="Inches";
public function getMeasurementb(){
return array(
self::g=>"Foot",
self::h=>"Inches"
);


}
	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'ramp';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('exit_detail_id', 'required'),
			array('provided, railing_provided, enclosure_provided, fire_door_provided, door_equipped_with_self_closing_device, door_with_proper_rating, door_provided_with_vision_panel, door_swing_in_the_direction_of_exit_travel, any_obstruction, exit_detail_id', 'numerical', 'integerOnly'=>true),
			array('type', 'length', 'max'=>8),
			array('ramp_width, height_from_the_floor, fd_width', 'length', 'max'=>11),
			array('units_of_measurement_of_ramp_width, units_of_measurement_of_the_height_from_the_floor, units_of_measurement_of_the_fd_width', 'length', 'max'=>6),
			array('class, enclosure_construction, fire_door_construction, if_yes_made_of, termination_or_discharge_of_exit', 'safe'),
			// The following rule is used by search().
			// Please remove those attributes that should not be searched.
			array('id, provided, type, ramp_width, units_of_measurement_of_ramp_width, class, railing_provided, height_from_the_floor, units_of_measurement_of_the_height_from_the_floor, enclosure_provided, enclosure_construction, fire_door_provided, fd_width, units_of_measurement_of_the_fd_width, fire_door_construction, door_equipped_with_self_closing_device, door_with_proper_rating, door_provided_with_vision_panel, if_yes_made_of, door_swing_in_the_direction_of_exit_travel, any_obstruction, termination_or_discharge_of_exit, exit_detail_id', 'safe', 'on'=>'search'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
			'exitDetail' => array(self::BELONGS_TO, 'ExitDetail', 'exit_detail_id'),
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'id' => 'ID',
			'provided' => 'Provided',
			'type' => 'Type',
			'ramp_width' => 'Ramp Width',
			'units_of_measurement_of_ramp_width' => 'Units Of Measurement Of Ramp Width',
			'class' => 'Class',
			'railing_provided' => 'Railing Provided',
			'height_from_the_floor' => 'Height From The Floor',
			'units_of_measurement_of_the_height_from_the_floor' => 'Units Of Measurement Of The Height From The Floor',
			'enclosure_provided' => 'Enclosure Provided',
			'enclosure_construction' => 'Enclosure Construction',
			'fire_door_provided' => 'Fire Door Provided',
			'fd_width' => 'Fd Width',
			'units_of_measurement_of_the_fd_width' => 'Units Of Measurement Of The Fd Width',
			'fire_door_construction' => 'Fire Door Construction',
			'door_equipped_with_self_closing_device' => 'Door Equipped With Self Closing Device',
			'door_with_proper_rating' => 'Door With Proper Rating',
			'door_provided_with_vision_panel' => 'Door Provided With Vision Panel',
			'if_yes_made_of' => 'If Yes Made Of',
			'door_swing_in_the_direction_of_exit_travel' => 'Door Swing In The Direction Of Exit Travel',
			'any_obstruction' => 'Any Obstruction',
			'termination_or_discharge_of_exit' => 'Termination Or Discharge Of Exit',
			'exit_detail_id' => 'Exit Detail',
		);
	}

	/**
	 * Retrieves a list of models based on the current search/filter conditions.
	 * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
	 */
	public function search()
	{
		// Warning: Please modify the following code to remove attributes that
		// should not be searched.

		$criteria=new CDbCriteria;

		$criteria->compare('id',$this->id);
		$criteria->compare('provided',$this->provided);
		$criteria->compare('type',$this->type,true);
		$criteria->compare('ramp_width',$this->ramp_width,true);
		$criteria->compare('units_of_measurement_of_ramp_width',$this->units_of_measurement_of_ramp_width,true);
		$criteria->compare('class',$this->class,true);
		$criteria->compare('railing_provided',$this->railing_provided);
		$criteria->compare('height_from_the_floor',$this->height_from_the_floor,true);
		$criteria->compare('units_of_measurement_of_the_height_from_the_floor',$this->units_of_measurement_of_the_height_from_the_floor,true);
		$criteria->compare('enclosure_provided',$this->enclosure_provided);
		$criteria->compare('enclosure_construction',$this->enclosure_construction,true);
		$criteria->compare('fire_door_provided',$this->fire_door_provided);
		$criteria->compare('fd_width',$this->fd_width,true);
		$criteria->compare('units_of_measurement_of_the_fd_width',$this->units_of_measurement_of_the_fd_width,true);
		$criteria->compare('fire_door_construction',$this->fire_door_construction,true);
		$criteria->compare('door_equipped_with_self_closing_device',$this->door_equipped_with_self_closing_device);
		$criteria->compare('door_with_proper_rating',$this->door_with_proper_rating);
		$criteria->compare('door_provided_with_vision_panel',$this->door_provided_with_vision_panel);
		$criteria->compare('if_yes_made_of',$this->if_yes_made_of,true);
		$criteria->compare('door_swing_in_the_direction_of_exit_travel',$this->door_swing_in_the_direction_of_exit_travel);
		$criteria->compare('any_obstruction',$this->any_obstruction);
		$criteria->compare('termination_or_discharge_of_exit',$this->termination_or_discharge_of_exit,true);
		$criteria->compare('exit_detail_id',$this->exit_detail_id);

		return new CActiveDataProvider($this, array(
			'criteria'=>$criteria,
		));
	}
}